package com.t14;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by xuyiwei on 2018/8/11.
 */
public class CarHandler implements InvocationHandler {
    private Car car;
    public CarHandler(Car car) {
        this.car = car;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.err.println("before");
        method.invoke(car, args);
        System.err.println("after");
        return null;
    }
}
